using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Windows.Markup;
using Rhizome.Contract;
using Rhizome.Contract.Diag;
using Rhizome.Model.Validation;

namespace Rhizome.Model
{
	[ContentProperty("Action")]
	public abstract class ActionRuleBase<TPlant> : RuleBase<TPlant>, IValidate
	{
		public IAction Action
		{
			[DebuggerStepThrough]
			get { return GetValue(ActionProperty); }
			[DebuggerStepThrough]
			set { SetValue(ActionProperty, value); }
		}

		#region Implementation of IValidate

		public IEnumerable<IValidationResult> GetValidationResults()
		{
			if (Action == null) yield return ValidationResult.ActionIsNull;
		}

		#endregion
	}

	public abstract class ActionRuleBase: ActionRuleBase<object>{}
}